package com.xjgzinfo.usdp.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;

/**
 * 大屏页面
 *
 * @author jxw
 */
@Entity
@Table(name = "blade_visual")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class BladeVisual implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GenericGenerator(name = "snowFlakeIdGenerator", strategy = "com.xjgzinfo.usdp.domain.util.SnowFlakeIdGenerator")
    @GeneratedValue(generator = "snowFlakeIdGenerator", strategy = GenerationType.SEQUENCE)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 大屏背景
     */
    @Lob
    @Column(name = "background_url")
    private String backgroundUrl;

    /**
     * 大屏类型
     */
    @Column(name = "category")
    private Long category;

    /**
     * 大屏标题
     */
    @Size(max = 255)
    @Column(name = "title", length = 255)
    private String title;

    /**
     * 修改人
     */
    @Column(name = "update_user")
    private Long updateUser;

    /**
     * 发布密码
     */
    @Size(max = 255)
    @Column(name = "password", length = 255)
    private String password;

    /**
     * 创建人
     */
    @Column(name = "create_user")
    private Long createUser;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    private Instant updateTime;

    /**
     * 创建部门
     */
    @Column(name = "create_dept")
    private Long createDept;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Instant createTime;

    /**
     * 状态
     */
    @NotNull
    @Max(value = 10)
    @Column(name = "status", nullable = false)
    private Integer status;

    /**
     * 是否已删除
     */
    @NotNull
    @Max(value = 10)
    @Column(name = "is_deleted", nullable = false)
    private Integer isDeleted;

    // jhipster-needle-entity-add-field - JHipster will add fields here
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBackgroundUrl() {
        return backgroundUrl;
    }

    public void setBackgroundUrl(String backgroundUrl) {
        this.backgroundUrl = backgroundUrl;
    }

    public BladeVisual backgroundUrl(String backgroundUrl) {
        this.backgroundUrl = backgroundUrl;
        return this;
    }

    public Long getCategory() {
        return category;
    }

    public void setCategory(Long category) {
        this.category = category;
    }

    public BladeVisual category(Long category) {
        this.category = category;
        return this;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public BladeVisual title(String title) {
        this.title = title;
        return this;
    }

    public Long getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }

    public BladeVisual updateUser(Long updateUser) {
        this.updateUser = updateUser;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public BladeVisual password(String password) {
        this.password = password;
        return this;
    }

    public Long getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }

    public BladeVisual createUser(Long createUser) {
        this.createUser = createUser;
        return this;
    }

    public Instant getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Instant updateTime) {
        this.updateTime = updateTime;
    }

    public BladeVisual updateTime(Instant updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public Long getCreateDept() {
        return createDept;
    }

    public void setCreateDept(Long createDept) {
        this.createDept = createDept;
    }

    public BladeVisual createDept(Long createDept) {
        this.createDept = createDept;
        return this;
    }

    public Instant getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Instant createTime) {
        this.createTime = createTime;
    }

    public BladeVisual createTime(Instant createTime) {
        this.createTime = createTime;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public BladeVisual status(Integer status) {
        this.status = status;
        return this;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public BladeVisual isDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
        return this;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof BladeVisual)) {
            return false;
        }
        return id != null && id.equals(((BladeVisual) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    // prettier-ignore
    @Override
    public String toString() {
        return "BladeVisual{" +
                "id=" + getId() +
                ", backgroundUrl='" + getBackgroundUrl() + "'" +
                ", category=" + getCategory() +
                ", title='" + getTitle() + "'" +
                ", updateUser=" + getUpdateUser() +
                ", password='" + getPassword() + "'" +
                ", createUser=" + getCreateUser() +
                ", updateTime='" + getUpdateTime() + "'" +
                ", createDept=" + getCreateDept() +
                ", createTime='" + getCreateTime() + "'" +
                ", status=" + getStatus() +
                ", isDeleted=" + getIsDeleted() +
                "}";
    }
}
